home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-15 | 8.4 KB | 227 lines | [TEXT/MPS ] |
- /*------------------------------------------------------------------------------
- *
- * Apple Macintosh Developer Technical Support
- *
- * Installer 3.2 sample: installing a desk accessory into the appropriate place
- *
- * File: InstallDA.r - Rez Source
- *
- * Modifications:
- * 5/19/93: RRK Changed Target file spec typeCrMustMatch flag setting to
- * typeCrMustMatch and included comment that this will
- * allow the replacement of the target file if for some reason
- * the file or creator are different.
- * Used InstallerCommon.r defines.
- *
- * by: Jon Zap
- * updated for use with Installer 3.4 by: Rich Kubota 9/1/92
- *
- * Copyright © 1991 Apple Computer, Inc.
- * All rights reserved.
- *
- *------------------------------------------------------------------------------
- * This sample installs the Key Caps DA into the appropriate place: the system file if we
- * are pre 7.0 or into the Apple Menu Items folder if we are 7.0 or later.
- * It allows for custom installation/removal.
- * We use the gestalt findfolder attributes to determine whether or not the Apple
- * Menu Items folder exists (assuming that there is a correlation between this
- * trap and the folder). The custom installation makes this difference explicit.
- * Notes of interest: if we are installing a DA into the system file (pre 7.0)
- * then we merely use an 'inra' that specifies the 'DRVR' resource in a suitcase
- * file by name, the DA's owned resources are handled by the installer
- *----------------------------------------------------------------------------*/
-
- #include "Types.r" /* for the ICON resource */
- #include "InstallerTypes.r"
- #include "InstallerCommon.r" /* list of macros to simplify list */
-
- /* You can build and complete the script with the following lines:
- # Note: set up floppies with the appropriate names and contents before running scriptcheck
- # or set up folders with the same names and contents as the floppies
- # put these folders in the same folder as the script or at the root directory of same disk
-
- rez -o "InstallDA" -t 'bbkr' -c 'bbkr' "InstallDA.r"
- setfile -a i "InstallDA" #mark Inited
- scriptcheck -p "InstallDA"
- */
-
- /* Definitions for the rules */
- #define rule7 1000
- #define rule6 1001
-
- /* Defines for the file spec atoms. These are specifications for source and destination files */
- #define fsSourceDA7 2000
- #define fsSourceDA6 2001
- #define fsTargetDA7 2002
- #define fsTargetSystem 2003
-
- /* This is the name of the source disk */
- #define DADisk "DA Disk:"
-
- /* where we want to install our DA. */
- #define TargetPath7 "special-amnu:"
- #define TargetPath6 "special-macs:"
-
- /* Definition for the package. */
- #define pkTheDA7 3000
- #define pkTheDA6 3001
-
- /* Definition for the file atom */
- #define faDA7 4000
-
- /* definition for the resource atom */
- #define raDA6 5000
-
- /* Definition for the package comment resource */
- #define cmtTheDA 6000
- #define iconTheDA 7000
-
- /* May 19, 1993 is the current release date I put in 'icmt' rsrcs. ScriptCheck will convert */
- /* this value to a LongInt seconds value needed by the Installer. */
- #define currentReleaseDate 5191993
- #define currentVersion 102 /* Version 1.0.2 goes in the 'icmt' rsrc */
-
- /* Gestalt definitions taken from the Gestalt.h file for use in the CheckGestalt clause */
- #define gestaltFindFolderAttr 'fold' /* Folder Mgr attributes */
-
-
- /************************** Easy Install Rule resources **********************************/
- resource 'infr' (1) {
- format0 {{
- pickFirst, {rule7, rule6}, /* Select the first rule */
- }};
- };
-
- /* note the '.' in the first rule is missing in the 2nd rule so we can differentiate*/
- resource 'inrl' (rule7) {
- format0 {{
- checkGestalt { gestaltFindFolderAttr, {1} },
- addUserDescription {"Click Install button to install\n"}, /* message to appear in Easy Install screen */
- addUserDescription {"• Key Caps(System 7.0)\n"},
- addPackages {{pkTheDA7}} /* we're installing the DA */
- }};
- };
- resource 'inrl' (rule6) {
- format0 {{
- addUserDescription {"Click Install button to install\n"}, /* message to appear in Easy Install screen */
- addUserDescription {"• Key Caps(System 6.0)\n"}, /* message to appear in Easy Install screen */
- addPackages {{pkTheDA6}} /* we're installing the DA */
- }};
- };
-
- /***************************** Package Resources ************************************************/
- resource 'inpk' (pkTheDA7) {
- format0 {
- showsOnCustom, /* Package appears in the Custom Install display */
- removable, /* Package can be removed */
- dontForceRestart, /* not necessary to reboot in this case */
- cmtTheDA, /* package's 'icmt' resource id */
- 0, /* Package size (filled in by ScriptCheck) */
- "DA -> Apple Menu folder (System 7.0)", { /* package name for package that shows on custom */
- 'infa', faDA7;
- }
- }
- };
-
- resource 'inpk' (pkTheDA6) {
- format0 {
- showsOnCustom, /* Package appears in the Custom Install display */
- removable, /* Package can be removed */
- forceRestart, /* major mod to system file, force reboot on live install */
- cmtTheDA, /* package's 'icmt' resource id */
- 0, /* Package size (filled in by ScriptCheck) */
- "Key Caps DA -> system file (Pre System 7.0)", { /* package name for package that shows on custom */
- 'inra', raDA6;
- }
- }
- };
-
- /***************************** Comments ************************************************/
- resource 'icmt' (cmtTheDA) {
- currentReleaseDate,
- currentVersion,
- iconTheDA,
- "This package installs the Key Caps DA. "
- };
-
- resource 'ICON' (iconTheDA) {
- $"0430 4000 0A50 A000 0B91 1002 0822 0803"
- $"1224 0405 2028 0209 4010 0111 800C 00A1"
- $"8003 FFC2 7E00 FF04 0100 7F04 0300 1E08"
- $"04E0 000C 08E0 000A 10E0 0009 08C0 0006"
- $"0487 FE04 0288 0104 0188 0084 0088 0044"
- $"0088 0044 0088 00C4 0110 0188 0228 0310"
- $"01C4 04E0 0002 0800 73BF FBEE 4CA2 8A2A"
- $"40AA AAEA 52AA AA24 5EA2 8AEA 73BE FB8E",
- };
-
-
-
- /********************************************* File Specs *******************************************/
- /* Source File Specs */
- resource 'infs' (fsSourceDA7) {
- 'dfil', /* File Type */
- 'keyc', /* Creator */
- kScriptCheckSetsDate, /* ScriptCheck fills in the creation date */
- noSearchForFile, /* Do not search the source disk for the file */
- typeCrMustMatch, /* file type and creator on source disk must match */
- DADisk"Key Caps 7.0" /* Path to the file */
- };
-
- resource 'infs' (fsSourceDA6) {
- 'DFIL', /* File Type */
- 'DMOV', /* Creator */
- kScriptCheckSetsDate, /* ScriptCheck fills in the creation date */
- noSearchForFile, /* Do not search the source disk for the file */
- typeCrMustMatch, /* file type and creator on source disk must match */
- DADisk"Key Caps 6.0" /* Path to the file */
- };
-
- /* Target File Specs */
- resource 'infs' (fsTargetDA7) {
- 'dfil', /* File Type */
- 'keyc', /* Creator */
- kNoDateStampCheck, /* creation date must be zero for target file spec */
- noSearchForFile, /* Do not search the target disk for the file */
- typeCrNeedNotMatch, /* file to be replaced even if F&C don't match */
- TargetPath7"Key Caps" /* destination Path */
- };
-
- resource 'infs' (fsTargetSystem) {
- 'ZSYS', /* File Type */
- 'MACS', /* Creator */
- kNoDateStampCheck, /* creation date must be zero for target file spec */
- noSearchForFile, /* Do not search the target disk for the file */
- typeCrNeedNotMatch, /* file to be found by name even if F&C don't match */
- TargetPath6"System" /* destination Path */
- };
-
- /******************************************** File Atoms ************************************************/
- resource 'infa' (faDA7) {
- format0 {
- StdRemLeaveNewerCopy, /* see InstallerCommon.r */
- fsTargetDA7, /* TARGET file spec for this file */
- fsSourceDA7, /* SOURCE file spec for this file */
- 0, /* atom size (filled in by ScriptCheck) */
- "" /* Atom Description (Installer will use file name) */
- };
- };
-
- /******************************************** Resource Atoms **********************************************/
- resource 'inra' (raDA6) {
- format0 {
- StdRemResCopyName, /* See InstallerCommon.r */
- fsTargetSystem, /* Target file spec to install rsrc into */
- fsSourceDA6, /* Source file spec where to get rsrc */
- 'DRVR', /* Resource type */
- 0, /* Resource source id */
- 0, /* Resource target id */
- 0, /* atom size (filled in by ScriptCheck) */
- "Desk Accessory: Key Caps", /* Atom description */
- "\0x00Key Caps" /* Resource name */
- };
- };
-
-
-
-